package com.huizu.pay.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * 支付宝
 * @author 
 */
public class AlipayConfig {
	public static String sign_type = "RSA2";// 签名方式RSA2
	public static String charset = "utf-8";// 字符编码格式
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";// 支付宝网关
	public static String gatewayUrl1 = "https://openapi.alipaydev.com/gateway.do";
	
	public static String log_path = "";// 支付宝网关
	public static String biz_content = "";// 请求参数集合
	
	/**
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库） 要写入日志里的文本内容
	 * @param sWord
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
